//
//  BaseViewController.m
//  AppYing
//
//  Created by appying_wxj on 14/10/27.
//  Copyright (c) 2014年 appying_wxj. All rights reserved.
//

#import "BaseViewController.h"

@interface BaseViewController ()

@end

@implementation BaseViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self initBaseUI];

    // Do any additional setup after loading the view.
}
-(void)initBaseUI{
    version = [[[UIDevice currentDevice] systemVersion] floatValue];//判断当前系统的版本号
    [self.navigationController setNavigationBarHidden:YES];// 隐藏系统的导航条
    _navBG = [[UIView alloc]initWithFrame:CGRectMake(0, 0, kScreen_Width, 64)];
    
    // 自定义导航条的背景
    _bgImageView= [[UIImageView alloc]initWithFrame:_navBG.bounds];
    _bgImageView.backgroundColor = [UIColor colorWithRed:0.76 green:0.85 blue:0.02 alpha:1];
    _bgImageView.userInteractionEnabled = YES;
    [_navBG addSubview:_bgImageView];
    [self.view addSubview:_navBG];
    
    // 导航条上面的标题的设置
    self.titleLab = [[UILabel alloc] init];
    self.titleLab.textColor = [UIColor whiteColor];
    self.titleLab.textAlignment = NSTextAlignmentCenter;
    self.titleLab.font = [UIFont fontWithName:@"FZZZHUNHJW--GB1-0" size:22];
    
    // 导航条上左边的按钮
    self.leftButton = [UIButton buttonWithType:UIButtonTypeCustom];
    [self.leftButton setBackgroundColor:[UIColor clearColor]];
    [self.leftButton setBackgroundImage:[UIImage imageNamed:@"image_back@2x"] forState:UIControlStateNormal];
    
    // 导航条上右边的按钮
    self.rigthButton = [UIButton buttonWithType:UIButtonTypeCustom];
    [self.rigthButton setBackgroundColor:[UIColor clearColor]];
    
    //各个组件的坐标及大小的设置
    self.leftButton.frame = CGRectMake(0, 20, 60, 40);
    self.rigthButton.frame = CGRectMake(260, 20, 60, 44);
    self.titleLab.frame = CGRectMake(60, 20, 200, 44);
    
    
    [_navBG addSubview:_leftButton];
    [_navBG addSubview:_rigthButton];
    [_navBG addSubview:_titleLab];
    
    
    
}
-(UIView *)createnavigationControllerView : (CGRect *)contentTexttField{
    UIView *customView = [[UIView alloc] initWithFrame:CGRectMake(0, 120, kScreen_Width, 80)];
    customView.backgroundColor = [UIColor whiteColor];
    
    [self.view addSubview:customView];
    return customView;
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
